/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.quangtin3.entity;

import java.io.Serializable;
import javax.persistence.*;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author Quang
 */
@Entity
@Table(name = "support_data_list")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "SupportDataList.findAll", query = "SELECT s FROM SupportDataList s"),
    @NamedQuery(name = "SupportDataList.findById", query = "SELECT s FROM SupportDataList s WHERE s.id = :id"),
    @NamedQuery(name = "SupportDataList.findByValue", query = "SELECT s FROM SupportDataList s WHERE s.value = :value")})
public class SupportDataList implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @NotNull
    @Column(name = "ID")
    private Integer id;
    @Size(max = 128)
    @Column(name = "VALUE")
    private String value;
    @JoinColumn(name = "COLLECTION_COLUMN", referencedColumnName = "ID")
    @ManyToOne(optional = false)
    private CollectionColumn collectionColumn;

    public SupportDataList() {
    }

    public SupportDataList(Integer id) {
        this.id = id;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getValue() {
        return value;
    }

    public void setValue(String value) {
        this.value = value;
    }

    public CollectionColumn getCollectionColumn() {
        return collectionColumn;
    }

    public void setCollectionColumn(CollectionColumn collectionColumn) {
        this.collectionColumn = collectionColumn;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof SupportDataList)) {
            return false;
        }
        SupportDataList other = (SupportDataList) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "org.quangtin3.entity.SupportDataList[ id=" + id + " ]";
    }
    
}
